home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / DOpus511 / dopus_pch.lha / ARexx.lha / Arexx / same.dopus5 < prev    next >
Text File  |  1995-06-03  |  1KB  |  47 lines

  1. /*
  2.  $VER:       CloneSRCE.dopus5 1.0 Jun-01-95
  3.  Written by: Gary Gagnon (garyg@wimsey.com)
  4.  Purpose:    ARexx script to clone SRCE lister(s)
  5.  Syntax:     From function editor "ARexx DOpus5:ARexx/Same.dopus5 {Qp}"
  6.  Note:       I keep my DOpus5 ARexx scripts in DOpus5:ARexx
  7.  Note:       If no listers flagged as SRCE, nothing is opened
  8. */
  9.  
  10. options results
  11.  
  12. parse arg portname
  13.  
  14. address value portname
  15.  
  16. 'lister query source'
  17.  
  18. srclist = result
  19.  
  20. if result = 'RESULT' then
  21.  exit 0
  22.  
  23. do forever
  24.  
  25.  if srclist = '' then
  26.    leave
  27.  
  28.  /* the following command line does a little ARexx magic */
  29.  /* try this with any other language - it won't be as simple! */
  30.  
  31.  parse var srclist curlist srclist
  32.  
  33.  /*
  34.     if you couldn't figure it out,  it extracts the first value from
  35.     the string and moves the remaining values (if any) back to the
  36.     same string.  This is what allows this to duplicate all SRCE
  37.     listers within this simple loop (and also makes sure it won't be
  38.     an endless loop). Languages without type checks can be nice!
  39.  */
  40.  
  41.  'lister new'
  42.  newlist = result
  43.  
  44.  'lister copy' curlist newlist
  45.  
  46. end
  47.